﻿@page "/"

<h1>Two components interacting with each other</h1>
<Show @ref="_showRef" Number="Number" />
<br/>
<p>Via public method</p>
<Increment OnValueChanged="Add"/>
<hr />
<p>Via parameter property</p>
<Increment OnValueChanged="Add2" />

@code
{
    Show _showRef;

    int Number { get; set;}

    void Add(int nbr)
    {
        _showRef.Display(nbr); 
    }

    void Add2(int nbr)
    {
        Number = nbr;
    }
}